package com.cntv.viewbindingdemo

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.cntv.viewbindingdemo.databinding.ActivityMainBinding

/**
 * ActivityMainBinding 对应xml布局名称+binding
 */
class MainActivity : AppCompatActivity() {
    private lateinit var viewBinding: ActivityMainBinding//和本类名对应
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
//        setContentView(R.layout.activity_main)
        viewBinding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(viewBinding.root)
        viewBinding.textView.text = "activity里的textView"
        viewBinding.textView.textSize=30f
        viewBinding.textView1.text = "${viewBinding.textView.text}字符串内嵌表达式"
        viewBinding.textView2.text = "top"
    }
}
